package com.jh.user.pojo;

import cn.jh.common.utils.DateUtil;
import com.google.common.base.MoreObjects;
import com.jh.user.pojo.validator.Create;
import com.jh.user.pojo.validator.Update;
import com.jh.user.pojo.validator.Verify;
import org.hibernate.validator.constraints.NotBlank;

import javax.persistence.*;
import javax.validation.constraints.NotNull;
import java.io.Serializable;
import java.math.BigDecimal;
import java.time.LocalDate;
import java.util.Date;

import static com.mysql.jdbc.StringUtils.isNullOrEmpty;
import static org.apache.commons.lang3.StringUtils.trimToEmpty;

@Entity
@Table(name = "t_shop_register")
public class ShopRegister implements Serializable {

    private static final long serialVersionUID = 1L;

    @GeneratedValue(strategy = GenerationType.IDENTITY)
    @Id
    @Column(name = "id")
    @NotNull(message = "id不能为空",groups = {Update.class,Verify.class})
    private Long id;

    @Column(name = "user_id")
    private Long userId;

    @Column(name = "shop_id")
    private String shopId;

    /**
     * 商户名称
     */
    @Column(name = "is_jf_pos")
    //@NotBlank(message = "是否即付不能为空", groups = {Create.class})
    private Integer isJfPos;
    /**
     * 商户名称
     */
    @Column(name = "shop_name")
//    @NotBlank(message = "商户名称不能为空", groups = {Create.class})
    private String shopName;

    /**
     * 商户简称
     */
    @Column(name = "shop_short_name")
//    @NotBlank(message = "商户简称不能为空", groups = {Create.class})
    private String shopShortName;

    /**
     * 注册名称
     */
    @Column(name = "shop_register_name")
//    @NotBlank(message = "注册名称不能为空", groups = {Create.class})
    private String shopRegisterName;

    /**
     * 省份
     */
    @Column(name = "shop_provinces")
//    @NotBlank(message = "省份不能为空", groups = {Create.class})
    private String shopProvinces;

    /**
     * 城市
     */
    @Column(name = "shop_city")
//    @NotBlank(message = "城市不能为空", groups = {Create.class})
    private String shopCity;

    /**
     * 行政县
     */
    @Column(name = "shop_areas")
 //   @NotBlank(message = "行政县不能为空", groups = {Create.class})
    private String shopAreas;

    /**
     * 商户地址
     */
    @Column(name = "shop_address")
//    @NotBlank(message = "商户地址不能为空", groups = {Create.class})
    private String shopAddress;

    /**
     * 商户联系人
     */
    @Column(name = "shop_user_name")
//    @NotBlank(message = "商户联系人不能为空", groups = {Create.class})
    private String shopUserName;

    /**
     * 联系人邮箱
     */
    @Column(name = "shop_user_email")
//    @NotBlank(message = "联系人邮箱不能为空", groups = {Create.class})
    private String shopUserEmail;

    /**
     * 联系人电话
     */
    @Column(name = "shop_user_phone")
//    @NotBlank(message = "联系人电话不能为空", groups = {Create.class})
    private String shopUserPhone;

    /**
     * 客服电话
     */
    @Column(name = "shop_customer_phone")
//    @NotBlank(message = "客服电话不能为空", groups = {Create.class})
    private String shopCustomerPhone;

    /**
     * 行业类别
     */
    @Column(name = "Industry_category")
//    @NotBlank(message = "行业类别不能为空", groups = {Create.class})
    private String industryCategory;

    /**
     * 入网商户类别  1企业 2个体户 3小微商户
     */
    @Column(name = "shop_type")
//    @NotNull(message = "入网商户类别不能为空", groups = {Create.class})
    private Integer shopType;

    /**
     * 执照证件号码
     */
    @Column(name = "shop_id_number")
//    @NotBlank(message = "执照证件号码不能为空", groups = {Create.class})
    private String shopIdNumber;

    /**
     * 证件到期时间
     */
    @Column(name = "shop_id_num_ex_time")
    private String shopIdNumExTime;

    /**
     * 办证时间
     */
    @Column(name = "shop_start_time")
    private String shopStartTime;

    @Transient
//    @NotNull(message = "证件到期时间不能为空", groups = {Create.class})
    private String shopIdNumExTimeStr;

    /**
     * 结算账户类型 1 对公 2 对私
     */
    @Column(name = "settle_account_type")
//    @NotNull(message = "结算账户类型不能为空", groups = {Create.class})
    private Integer settleAccountType;

    /**
     * 入网证件类型 1三合一 2营业执照
     */
    @Column(name = "id_number_type")
//    @NotNull(message = "入网证件类型不能为空", groups = {Create.class})
    private Integer idNumberType;

    /**
     * 法人代表名称
     */
    @Column(name = "legal_name")
//    @NotBlank(message = "法人代表名称不能为空", groups = {Create.class})
    private String legalName;

    /**
     * 法人身份证
     */
    @Column(name = "legal_id_number")
//    @NotBlank(message = "法人身份证不能为空", groups = {Create.class})
    private String legalIdNumber;

    /**
     * 法人身份证有效期
     */
    @Column(name = "legal_ex_time")
    private String legalExTime;

    @Transient
//    @NotNull(message = "法人身份证有效期不能为空", groups = {Create.class})
    private String legalExTimeStr;

    /**
     * 结算账户开户名
     */
    @Column(name = "settle_account_name")
//    @NotBlank(message = "结算账户开户名不能为空", groups = {Create.class})
    private String settleAccountName;

    /**
     * 结算账户开户号
     */
    @Column(name = "settle_account_number")
//    @NotBlank(message = "结算账户开户号不能为空", groups = {Create.class})
    private String settleAccountNumber;

    /**
     * 银行预留手机号
     */
    @Column(name = "bank_phone")
    private String bankPhone;

    /**
     * 结算账户开户行
     */
    @Column(name = "settle_bank")
//    @NotBlank(message = "结算账户开户行不能为空", groups = {Create.class})
    private String settleBank;

    /**
     * 结算户支行地址
     */
    @Column(name = "settle_bank_address")
//    @NotBlank(message = "结算户支行地址不能为空", groups = {Create.class})
    private String settleBankAddress;

    /**
     * 结算户开户支行
     */
    @Column(name = "settle_branch_bank")
//    @NotBlank(message = "结算户开户支行不能为空", groups = {Create.class})
    private String settleBranchBank;

    /**
     * 交易支付费率
     */
    @Column(name = "pay_rate")
    private BigDecimal payRate;

    /**
     * 商户入网备注
     */
    @Column(name = "remark")
    private String remark;

    /**
     * 营业执照照片
     */
//    @Column(name = "business_pic")
    //@NotBlank(message = "营业执照照片不能为空", groups = {Create.class})
//    private String businessPic;

    /**
     * 法人身份证正面sta
     */
//    @Column(name = "legal_id_pic")
    //@NotBlank(message = "法人身份证正面路径不能为空", groups = {Create.class})
//    private String legalIdPic;

    /**
     * 法人身份证反面
     */
//    @Column(name = "legal_id_back_pic")
    //@NotBlank(message = "法人身份证反面路径不能为空", groups = {Create.class})
//    private String legalIdBackPic;

    /**
     * 商户门头照片
     */
//    @Column(name = "shop_head_pic")
    //@NotBlank(message = "商户门头照片路径不能为空", groups = {Create.class})
//    private String shopHeadPic;

    /**
     * 内部前台照片
     */
//    @Column(name = "first_pic")
    //@NotBlank(message = "内部前台照片路径不能为空", groups = {Create.class})
//    private String firstPic;

    /**
     * 开户许可证照片
     */
//    @Column(name = "account_pic")
    //@NotBlank(message = "开户许可证照片路径不能为空", groups = {Create.class})
//    private String accountPic;
    /**
     * 银行卡正面照片
     */
//    @Column(name = "bank_front_pic")
//    private String bankFrontPic;

    /**
     * 银行卡反面照片
     */
//    @Column(name = "bank_reverse_pic")
//    private String bankReversePic;

    /**
     * 商户场景照片
     */
//    @Column(name = "mch_scene_pic")
//    private String mchScenePic;


    /**
     * 商户总分店关系证明
     */
//    @Column(name = "relationship_pic")
  // @NotBlank(message = "商户总分店关系证明照片路径不能为空", groups = {Create.class})
//    private String relationshipPic;

    /**
     * 商户增值协议
     */
//    @Column(name = "merchant_pic")
   // @NotBlank(message = "商户增值协议路径不能为空", groups = {Create.class})
//    private String merchantPic;

    /**
     * 支付宝配置id
     */
    @Column(name = "alipay_app_id")
    private String alipayAppId;

    /**
     * 微信配置id
     */
    @Column(name = "wechat_app_id")
    private String wechatAppId;

    /**
     * 状态   0未审核1 审核中 2后台审核失败  3即付审核中 4即付审核失败 5成功
     */
    @Column(name = "status")
    @NotNull(message = "状态不能为空",groups = {Verify.class})
    private Integer status;

    /**
     * 审核备注
     */
    @Column(name = "verify_remark")
    private String  verifyRemark;

    /**
     * 支付宝通道费率
     */
    @Column(name = "alipay_channel_rate")
    private String alipayChannelRate;

    /**
     * 微信通道费率
     */
    @Column(name = "wechat_channel_rate")
    private String wechatChannelRate;

    /** 微信开关 */
    @Column(name = "wechat_switch")
    private String wechatSwitch;

    /** 支付宝开关 */
    @Column(name = "alipay_switch")
    private String alipaySwitch;

    /**
     * 代理商手机号
     */
    @Column(name = "agent_phone")
    private String agentPhone;

    /**
     * 手机号
     */
    @Column(name = "mobile_phone")
    @NotBlank(message = "手机号不能为空", groups = {Create.class})
    private String mobilePhone;

    /**
     * 银行城市
     */
    @Column(name = "settle_bank_city")
    private String settleBankCity;

    /**x
     * 银行省份id
     */
    @Column(name = "settle_bank_address_id")
    private String settleBankAddressId;

    /**x
     * 所属贴牌ID
     */
    @Column(name = "brand_id")
    private long brandId;

    /**
     * 商家支付宝账号
     */
    @Column(name = "alipay_account")
//    @NotBlank(message = "商家支付宝账号不能为空", groups = {Create.class})
    private String alipayAccount;

    /**
     * 更新时间
     */
    @Column(name = "update_time")
    private Date updateTime;

    /**
     * 创建时间
     */
    @Column(name = "create_time")
    private Date createTime;

    /**
     * 商户所在省id
     */
    @Transient
    private String provinceId;

    /**
     * 商户所在市id
     */
    @Transient
    private String cityId;

    public long getBrandId() {
        return brandId;
    }

    public void setBrandId(long brandId) {
        this.brandId = brandId;
    }

//    public String getBankFrontPic() {
//        return bankFrontPic;
//    }

//    public void setBankFrontPic(String bankFrontPic) {
//        this.bankFrontPic = bankFrontPic;
//    }

//    public String getBankReversePic() {
//        return bankReversePic;
//    }

//    public void setBankReversePic(String bankReversePic) {
//        this.bankReversePic = bankReversePic;
//    }

//    public String getMchScenePic() {
//        return mchScenePic;
//    }

//    public void setMchScenePic(String mchScenePic) {
//        this.mchScenePic = mchScenePic;
//    }

    public Long getId() {
        return id;
    }

    public void setId(Long id) {
        this.id = id;
    }

    public Long getUserId() {
        return userId;
    }

    public void setUserId(Long userId) {
        this.userId = userId;
    }

    public String getShopStartTime() {
        return shopStartTime;
    }

    public void setShopStartTime(String shopStartTime) {
        this.shopStartTime = shopStartTime;
    }

    public String getShopName() {
        return shopName;
    }

    public void setShopName(String shopName) {
        this.shopName = shopName;
    }


    public String getShopShortName() {
        return shopShortName;
    }

    public void setShopShortName(String shopShortName) {
        this.shopShortName = shopShortName;
    }

    public String getShopRegisterName() {
        return shopRegisterName;
    }

    public void setShopRegisterName(String shopRegisterName) {
        this.shopRegisterName = shopRegisterName;
    }

    public String getShopProvinces() {
        return shopProvinces;
    }

    public void setShopProvinces(String shopProvinces) {
        this.shopProvinces = shopProvinces;
    }

    public String getShopCity() {
        return shopCity;
    }

    public void setShopCity(String shopCity) {
        this.shopCity = shopCity;
    }

    public String getShopAreas() {
        return shopAreas;
    }

    public void setShopAreas(String shopAreas) {
        this.shopAreas = shopAreas;
    }

    public String getShopAddress() {
        return shopAddress;
    }

    public void setShopAddress(String shopAddress) {
        this.shopAddress = shopAddress;
    }

    public String getShopUserName() {
        return shopUserName;
    }

    public void setShopUserName(String shopUserName) {
        this.shopUserName = shopUserName;
    }

    public String getShopUserEmail() {
        return shopUserEmail;
    }

    public void setShopUserEmail(String shopUserEmail) {
        this.shopUserEmail = shopUserEmail;
    }

    public String getShopUserPhone() {
        return shopUserPhone;
    }

    public void setShopUserPhone(String shopUserPhone) {
        this.shopUserPhone = shopUserPhone;
    }

    public String getShopCustomerPhone() {
        return shopCustomerPhone;
    }

    public void setShopCustomerPhone(String showCustomerPhone) {
        this.shopCustomerPhone = showCustomerPhone;
    }

    public String getIndustryCategory() {
        return industryCategory;
    }

    public void setIndustryCategory(String industryCategory) {
        this.industryCategory = industryCategory;
    }

    public Integer getShopType() {
        return shopType;
    }

    public void setShopType(Integer shopType) {
        this.shopType = shopType;
    }

    public String getShopIdNumber() {
        return shopIdNumber;
    }

    public void setShopIdNumber(String shopIdNumber) {
        this.shopIdNumber = shopIdNumber;
    }

    public String getShopIdNumExTime() {
        return shopIdNumExTime;
    }

    public void setShopIdNumExTime(String shopIdNumExTime) {
        this.shopIdNumExTime = shopIdNumExTime;
    }

    public Integer getSettleAccountType() {
        return settleAccountType;
    }

    public void setSettleAccountType(Integer settleAccountType) {
        this.settleAccountType = settleAccountType;
    }

    public Integer getIdNumberType() {
        return idNumberType;
    }

    public void setIdNumberType(Integer idNumberType) {
        this.idNumberType = idNumberType;
    }

    public String getLegalName() {
        return legalName;
    }

    public void setLegalName(String legalName) {
        this.legalName = legalName;
    }

    public String getLegalIdNumber() {
        return legalIdNumber;
    }

    public void setLegalIdNumber(String legalIdNumber) {
        this.legalIdNumber = legalIdNumber;
    }

    public String getLegalExTime() {
        return legalExTime;
    }

    public void setLegalExTime(String legalExTime) {
        this.legalExTime = legalExTime;
    }

    public String getSettleAccountName() {
        return settleAccountName;
    }

    public void setSettleAccountName(String settleAccountName) {
        this.settleAccountName = settleAccountName;
    }

    public String getSettleAccountNumber() {
        return settleAccountNumber;
    }

    public void setSettleAccountNumber(String settleAccountNumber) {
        this.settleAccountNumber = settleAccountNumber;
    }

    public String getBankPhone() {
        return bankPhone;
    }

    public void setBankPhone(String bankPhone) {
        this.bankPhone = bankPhone;
    }

    public String getSettleBank() {
        return settleBank;
    }

    public void setSettleBank(String settleBank) {
        this.settleBank = settleBank;
    }

    public String getSettleBankAddress() {
        return settleBankAddress;
    }

    public void setSettleBankAddress(String settleBankAddress) {
        this.settleBankAddress = settleBankAddress;
    }

    public String getSettleBranchBank() {
        return settleBranchBank;
    }

    public void setSettleBranchBank(String settleBranchBank) {
        this.settleBranchBank = settleBranchBank;
    }

    public BigDecimal getPayRate() {
        return payRate;
    }

    public void setPayRate(BigDecimal payRate) {
        this.payRate = payRate;
    }

    public String getRemark() {
        return remark;
    }

    public void setRemark(String remark) {
        this.remark = remark;
    }

//    public String getBusinessPic() {
//        return businessPic;
//    }

//    public void setBusinessPic(String businessPic) {
//        this.businessPic = businessPic;
//    }

//    public String getLegalIdPic() {
//        return legalIdPic;
//    }

//    public void setLegalIdPic(String legalIdPic) {
//        this.legalIdPic = legalIdPic;
//    }

//    public String getLegalIdBackPic() {
//        return legalIdBackPic;
//    }

//    public void setLegalIdBackPic(String legalIdBackPic) {
//        this.legalIdBackPic = legalIdBackPic;
//    }

//    public String getShopHeadPic() {
//        return shopHeadPic;
//    }

//    public void setShopHeadPic(String shopHeadPic) {
//        this.shopHeadPic = shopHeadPic;
//    }

//    public String getFirstPic() {
//        return firstPic;
//    }

//    public void setFirstPic(String firstPic) {
//        this.firstPic = firstPic;
//    }

//    public String getAccountPic() {
//        return accountPic;
//    }

//    public void setAccountPic(String accountPic) {
//        this.accountPic = accountPic;
//    }

//    public String getRelationshipPic() {
//        return relationshipPic;
//    }

//    public void setRelationshipPic(String relationshipPic) {
//        this.relationshipPic = relationshipPic;
//    }

//    public String getMerchantPic() {
//        return merchantPic;
//    }

//    public void setMerchantPic(String merchantPic) {
//        this.merchantPic = merchantPic;
//    }

    public String getShopId() {
        return shopId;
    }

    public void setShopId(String shopId) {
        this.shopId = shopId;
    }

    public String getAlipayAppId() {
        return alipayAppId;
    }

    public void setAlipayAppId(String alipayAppId) {
        this.alipayAppId = alipayAppId;
    }

    public String getWechatAppId() {
        return wechatAppId;
    }

    public void setWechatAppId(String wechatAppId) {
        this.wechatAppId = wechatAppId;
    }

    public Date getCreateTime() {
        return createTime;
    }

    public void setCreateTime(Date createTime) {
        this.createTime = createTime;
    }

    public String getLegalExTimeStr() {
        return legalExTimeStr;
    }

    public void setLegalExTimeStr(String legalExTimeStr) {
        this.legalExTimeStr = legalExTimeStr;
        this.legalExTime = legalExTimeStr;
    }

    public String getShopIdNumExTimeStr() {
        return shopIdNumExTimeStr;
    }

    public void setShopIdNumExTimeStr(String shopIdNumExTimeStr) {
        this.shopIdNumExTimeStr = shopIdNumExTimeStr;
        this.shopIdNumExTime = shopIdNumExTimeStr;
    }

    public Integer getStatus() {
        return status;
    }

    public void setStatus(Integer status) {
        this.status = status;
    }

    public Integer getIsJfPos() {
        return isJfPos;
    }

    public void setIsJfPos(Integer isJfPos) {
        this.isJfPos = isJfPos;
    }

    public String getVerifyRemark() {
        return verifyRemark;
    }

    public void setVerifyRemark(String verifyRemark) {
        this.verifyRemark = verifyRemark;
    }

    public String getAlipayChannelRate() {
        return alipayChannelRate;
    }

    public void setAlipayChannelRate(String alipayChannelRate) {
        this.alipayChannelRate = alipayChannelRate;
    }

    public String getWechatChannelRate() {
        return wechatChannelRate;
    }

    public void setWechatChannelRate(String wechatChannelRate) {
        this.wechatChannelRate = wechatChannelRate;
    }

    public String getWechatSwitch() {
        return wechatSwitch;
    }

    public void setWechatSwitch(String wechatSwitch) {
        this.wechatSwitch = wechatSwitch;
    }

    public String getAlipaySwitch() {
        return alipaySwitch;
    }

    public void setAlipaySwitch(String alipaySwitch) {
        this.alipaySwitch = alipaySwitch;
    }


    public String getAgentPhone() {
        return agentPhone;
    }

    public void setAgentPhone(String agentPhone) {
        this.agentPhone = agentPhone;
    }

    public String getMobilePhone() {
        return mobilePhone;
    }

    public void setMobilePhone(String mobilePhone) {
        this.mobilePhone = mobilePhone;
    }

    public String getSettleBankCity() {
        return settleBankCity;
    }

    public void setSettleBankCity(String settleBankCity) {
        this.settleBankCity = settleBankCity;
    }

    public String getSettleBankAddressId() {
        return settleBankAddressId;
    }

    public void setSettleBankAddressId(String settleBankAddressId) {
        this.settleBankAddressId = settleBankAddressId;
    }

    public String getAlipayAccount() {
        return alipayAccount;
    }

    public void setAlipayAccount(String alipayAccount) {
        this.alipayAccount = alipayAccount;
    }

    public Date getUpdateTime() {
        return updateTime;
    }

    public void setUpdateTime(Date updateTime) {
        this.updateTime = updateTime;
    }

    public String getProvinceId() {
        return provinceId;
    }

    public void setProvinceId(String provinceId) {
        this.provinceId = provinceId;
    }

    public String getCityId() {
        return cityId;
    }

    public void setCityId(String cityId) {
        this.cityId = cityId;
    }

    @Override
    public String toString() {
        return MoreObjects.toStringHelper(this)
                .add("id", id)
                .add("userId", userId)
                .add("shopId", shopId)
                .add("isJfPos", isJfPos)
                .add("shopName", shopName)
                .add("shopShortName", shopShortName)
                .add("shopRegisterName", shopRegisterName)
                .add("shopProvinces", shopProvinces)
                .add("shopCity", shopCity)
                .add("shopAreas", shopAreas)
                .add("shopAddress", shopAddress)
                .add("shopUserName", shopUserName)
                .add("shopUserEmail", shopUserEmail)
                .add("shopUserPhone", shopUserPhone)
                .add("shopCustomerPhone", shopCustomerPhone)
                .add("industryCategory", industryCategory)
                .add("shopType", shopType)
                .add("shopIdNumber", shopIdNumber)
                .add("shopIdNumExTime", shopIdNumExTime)
                .add("shopIdNumExTimeStr", shopIdNumExTimeStr)
                .add("settleAccountType", settleAccountType)
                .add("idNumberType", idNumberType)
                .add("legalName", legalName)
                .add("legalIdNumber", legalIdNumber)
                .add("legalExTime", legalExTime)
                .add("legalExTimeStr", legalExTimeStr)
                .add("settleAccountName", settleAccountName)
                .add("settleAccountNumber", settleAccountNumber)
                .add("bankPhone", bankPhone)
                .add("settleBank", settleBank)
                .add("settleBankAddress", settleBankAddress)
                .add("settleBranchBank", settleBranchBank)
                .add("payRate", payRate)
                .add("remark", remark)
//                .add("businessPic", businessPic)
//                .add("legalIdPic", legalIdPic)
//                .add("legalIdBackPic", legalIdBackPic)
//                .add("shopHeadPic", shopHeadPic)
//                .add("firstPic", firstPic)
//                .add("accountPic", accountPic)
//                .add("bankFrontPic", bankFrontPic)
//                .add("bankReversePic", bankReversePic)
//                .add("mchScenePic", mchScenePic)
//                .add("relationshipPic", relationshipPic)
//                .add("merchantPic", merchantPic)
                .add("alipayAppId", alipayAppId)
                .add("wechatAppId", wechatAppId)
                .add("status", status)
                .add("verifyRemark", verifyRemark)
                .add("alipayChannelRate", alipayChannelRate)
                .add("wechatChannelRate", wechatChannelRate)
                .add("wechatSwitch", wechatSwitch)
                .add("alipaySwitch", alipaySwitch)
                .add("agentPhone", agentPhone)
                .add("mobilePhone", mobilePhone)
                .add("settleBankCity", settleBankCity)
                .add("settleBankAddressId", settleBankAddressId)
                .add("brandId", brandId)
                .add("alipayAccount", alipayAccount)
                .add("updateTime", updateTime)
                .add("createTime", createTime)
                .add("cityId", cityId)
                .add("provinceId", provinceId)
                .toString();
    }

    /**
     * 一些属性不予修改
     */
    public ShopRegister notUpdateProps() {
        setIsJfPos(null);
        setShopId(null);
        setUserId(null);
        setPayRate(null);
        return this;
    }

    /**
     * 将已存在的图片信息移植到待更新的商户进件信息中，以免丢失
     */
    public ShopRegister storeExistsPic(ShopRegister shopRegister, ShopRegister existsRegister) {
//        String businessPic = trimToEmpty(existsRegister.getBusinessPic());
//        String firstPic = trimToEmpty(existsRegister.getFirstPic());
//        String shopHeadPic = trimToEmpty(existsRegister.getShopHeadPic());
//        String accountPic = trimToEmpty(existsRegister.getAccountPic());
//        String legalIdBackPic = trimToEmpty(existsRegister.getLegalIdBackPic());
//        String legalIdPic = trimToEmpty(existsRegister.getLegalIdPic());
//        String bankFrontPic = trimToEmpty(existsRegister.getBankFrontPic());
//        String bankReversePic = trimToEmpty(existsRegister.getBankReversePic());
//        String mchScenePic = trimToEmpty(existsRegister.getMchScenePic());

//        if ("empty".equalsIgnoreCase(shopRegister.getBusinessPic()) || isNullOrEmpty(shopRegister.getBusinessPic())) {
//            shopRegister.setBusinessPic(businessPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getFirstPic()) || isNullOrEmpty(shopRegister.getFirstPic())) {
//            shopRegister.setFirstPic(firstPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getShopHeadPic()) || isNullOrEmpty(shopRegister.getShopHeadPic())) {
//            shopRegister.setShopHeadPic(shopHeadPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getAccountPic()) || isNullOrEmpty(shopRegister.getAccountPic())) {
//            shopRegister.setAccountPic(accountPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getLegalIdBackPic()) || isNullOrEmpty(shopRegister.getLegalIdBackPic())) {
//            shopRegister.setLegalIdBackPic(legalIdBackPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getLegalIdPic()) || isNullOrEmpty(shopRegister.getLegalIdPic())) {
//            shopRegister.setLegalIdPic(legalIdPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getBankFrontPic()) || isNullOrEmpty(shopRegister.getBankFrontPic())) {
//            shopRegister.setBankFrontPic(bankFrontPic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getBankReversePic()) || isNullOrEmpty(shopRegister.getBankReversePic())) {
//            shopRegister.setBankReversePic(bankReversePic);
//        }
//        if ("empty".equalsIgnoreCase(shopRegister.getMchScenePic()) || isNullOrEmpty(shopRegister.getMchScenePic())) {
//            shopRegister.setMchScenePic(mchScenePic);
//        }


        return shopRegister;
    }

    public ShopRegister resolveValidPicUrl() {
//        if ("empty".equals(getBusinessPic())) {
//            setBusinessPic("");
//        }
//        if ("empty".equals(getFirstPic())) {
//            setFirstPic("");
//        }
//        if ("empty".equals(getShopHeadPic())) {
//            setShopHeadPic("");
//        }
//        if ("empty".equals(getAccountPic())) {
//            setAccountPic("");
//        }
//        if ("empty".equals(getLegalIdBackPic())) {
//            setLegalIdBackPic("");
//        }
//        if ("empty".equals(getLegalIdPic())) {
//            setLegalIdPic("");
//        }
//        if ("empty".equals(getBankFrontPic())) {
//            setBankFrontPic("");
//        }
//        if ("empty".equals(getBankReversePic())) {
//            setBankReversePic("");
//        }
//        if ("empty".equals(getMchScenePic())) {
//            setMchScenePic("");
//        }
        return this;
    }

//    public void modifyShopRegister(ShopRegister register) {
//        setIsJfPos(register.getIsJfPos());
//        setShopName(register.getShopName());
//        setShopShortName(register.getShopShortName());
//        setShopRegisterName(register.getShopRegisterName());
//        setShopProvinces(register.getShopProvinces());
//        setShopCity(register.getShopCity());
//        setShopAreas(register.getShopAreas());
//        setShopAddress(register.getShopAddress());
//        setShopUserName(register.getShopUserName());
//        setShopUserEmail(register.getShopUserEmail());
//        setShopUserPhone(register.getShopUserPhone());
//        setShopCustomerPhone(register.getShopCustomerPhone());
//        setIndustryCategory(register.getIndustryCategory());
//        setShopType(register.getShopType());
//        setShopIdNumber(register.getShopIdNumber());
//        setShopIdNumExTime(register.getShopIdNumExTime());
//        setShopStartTime(register.getShopStartTime());
//        setSettleAccountType(register.getSettleAccountType());
//        setIdNumberType(register.getIdNumberType());
//        setLegalName(register.getLegalName());
//        setLegalIdNumber(register.getLegalIdNumber());
//        setLegalExTime(register.getLegalExTime());
//        setSettleAccountName(register.getSettleAccountName());
//        setSettleAccountNumber(register.getSettleAccountNumber());
//        setBankPhone(register.getBankPhone());
//        setBankPhone(register.getBankPhone());
//        setSettleBankAddress(register.getSettleBankAddress());
//        setSettleBranchBank(register.getSettleBranchBank());
//        setPayRate(register.getPayRate());
//        setRemark(register.getRemark());
//    }
}
